package gwt.immunology.client.components;

import java.util.Iterator;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiConstructor;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class CustomBox extends Composite implements HasWidgets {

    private static CustomBoxUiBinder uiBinder = GWT.create(CustomBoxUiBinder.class);

    interface CustomBoxUiBinder extends UiBinder<Widget, CustomBox> {
    }

    public CustomBox() {
        initWidget(uiBinder.createAndBindUi(this));
    }

    @UiConstructor
    public CustomBox(String text) {
        initWidget(uiBinder.createAndBindUi(this));
        this.windowHeaderText.setText(text);
    }

    @UiField
    FlowPanel main;

    @UiField
    Label windowHeaderText;

    @Override
    public void add(Widget w) {
        main.add(w);
    }

    @Override
    public void clear() {
        main.clear();
    }

    @Override
    public Iterator<Widget> iterator() {
        return main.iterator();
    }

    @Override
    public boolean remove(Widget w) {
        return main.remove(w);
    }
}
